package general.interfaces;

import general.datastructures.Vector2f;
import general.exceptions.Exception;

/**
 * This interface should be implemented by all Classes which can be hit by an {@link IShooter} Class
 * 
 * @author Alex, Tim
 * @version 0.4.1
 * @since 0.3.0
 */
public interface IHitable {

	/**
	 * 
	 * @return the current amount of hitpoints
	 */
	int getHitPoints();
	
	/**
	 * This Method should implement everything that happens, if this {@link IHitable} is hit by 
	 * an {@link IShooter} it also should calculate if this {@link IHitable} is hit or missed. 
	 * Usually this method is called by an {@link IHitable} 
	 * 
	 * @param attackpoints The amount of hitpoints which the {@link IHitable} loses if it is hit
	 * @return {@link Exception} Errorcode
	 */
	int hit(int attackpoints);
	
	/**
	 * This Method should repair the {@link IHitable}. If the passed amount of Hitpoints is larger than
	 * the {@link IHitable} can have, the {@link IHitable} only repairs, till its hitpoints are full 
	 * and returns this amount
	 * 
	 * @param amount The maxium amount of hitpoints which could be passed to this {@link IHitable}
	 * @return the Amount of hitpoints which was loaded absolutly
	 */
	int repair(int amount);
	
	/**
	 * @return the {@link Point} where the {@link IMovable} is located
	 */
	Vector2f getPosition();
}
